package com.heima.article.controller;

import com.heima.article.entity.ApAuthor;
import com.heima.article.service.ApArticleService;
import com.heima.article.service.ApAuthorService;
import com.heima.model.article.dtos.AuthorDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author RMY
 * @Date 2021/11/26 16:42
 * @Version 1.0
 */
@RestController
public class ApAuthorController {
    @Autowired
    private ApAuthorService apAuthorService;

    /**
     * 保存作者
     * @param authorDto
     * @return
     */
    @PostMapping("/api/v1/author/save")
    public Integer save(@RequestBody AuthorDto authorDto){
        return apAuthorService.saveAuthor(authorDto);
    }
}
